
////////////////////////////////////////////////////////////////////////////////////////////
// 文件名: SysViewGroupDAL.cs
//
// 模块名称: SysViewGroup
//
// 作者: yqf
//
// 历史记录（记录修改记录，修改文件后请添加修改记录，注明修改时间、修改人，修改内容）:
// 2013-01-22    yqf    创建文件
////////////////////////////////////////////////////////////////////////////////////////////

using System;
using System.Data;
using System.Linq;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
using HIDB;
using Model;
using Common;
using System.Configuration;

namespace DAL
{
    /// <summary>
    /// SysViewGroup表数据访问层
    /// </summary>
    public partial class SysViewGroupDAL : DB
    {
        public SysViewGroupDAL(LoginInfo info)
        {
            base.loginInfo = info;
        }
        /// <summary>
        /// 更新SysViewGroup表记录
        /// </summary>
        /// <param name="SysViewGroup">SysViewGroup实体对象</param>
        public string Update(IDataParameter[] sqlparams)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                DataTable dt = con.StoredDataTable("Working_db.UP_SysViewGroup_Update", sqlparams);
                if (dt != null && dt.Rows.Count > 0)
                    return dt.Rows[0][0].ToString();
                else
                    return "0";
            }
            catch (Exception ex) { throw ex; }
        }
        /// <summary>
        /// 更新表记录
        /// </summary>
        /// <param name="SysViewGroup">Approve实体对象</param>
        public void UpdateApprove(IDataParameter[] sqlparams)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                con.StoredUpdate("Working_db.UP_SysView_UpdateApprove", sqlparams);
            }
            catch (Exception ex) { throw ex; }
        }
        /// <summary>
        /// 视图审核
        /// </summary> 
        public void CheckApprove(Dictionary<string, object> appInfo)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                string msg = string.Empty;
                bool approve = true;
                string auditID = string.Empty;
                int timeOut = 0;
                int performance = 0;
                var paras = new IDataParameter[6];
                paras[0] = new SqlParameter("@TargetSysCode", loginInfo.ETLTargetCode);
                paras[1] = new SqlParameter("@TargetSysName", "");
                paras[2] = new SqlParameter("@Status", 0);
                paras[3] = new SqlParameter("@TargetType", 0);
                paras[4] = new SqlParameter("@Rows", 10);
                paras[5] = new SqlParameter("@PageNum", 1);
                EtlTargetSystemDAL etlTargetSystemDAL = new DAL.EtlTargetSystemDAL(loginInfo);
                var list = etlTargetSystemDAL.GetList(paras);
                if (list.Count > 0)
                {
                    timeOut = list[0].Timeout;
                    performance = list[0].Performance;
                }
                //检查超时时间 Server=10.199.200.227;uid=sa;pwd=Wandavm2010;database=MDM_Platform;
                string strConnection = string.Format("Server={0};database={1};uid={2}; password={3};",
                    con.DbAddress, loginInfo.DBName, loginInfo.Dbuser, loginInfo.Dbpwd);
                SysTBViewDAL tbDal = new SysTBViewDAL(loginInfo);
                SysTBView viewModel = tbDal.GetItem(appInfo["vid"].ToString());


                using (SqlConnection connection = new SqlConnection(strConnection))
                {
                    try
                    {
                        //检查创建状态
                        DataTable dt = new DataTable();
                        IDataParameter[] sqlparams = new SqlParameter[3];
                        sqlparams[0] = new SqlParameter("@vwID", appInfo["vid"]);
                        sqlparams[1] = new SqlParameter("@ViewGroupID", appInfo["id"]);
                        sqlparams[2] = new SqlParameter("@UserName", loginInfo.Dbuser);
                        dt = con.StoredDataTable("Working_db.Sys_ViewAudit", sqlparams);
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            //string au = dt.Rows[0][0].ToString();
                            //if (au != "1")
                            //{
                            //    msg = au;
                            //    approve = false;
                            //}
                            //else
                            auditID = dt.Rows[0][1].ToString();
                        }
                        if (approve)
                        {
                            //检查效率   
                            string sqlCount = string.Format("select count(*) from ({0}) a", viewModel.Definition);


                            DataTable dtSqlTime = new DataTable();
                            connection.Open();
                            SqlCommand sqlcmd = new SqlCommand();
                            sqlcmd.CommandText = viewModel.Definition;
                            sqlcmd.Connection = connection;
                            sqlcmd.CommandTimeout = timeOut;
                            DateTime st = DateTime.Now;
                            sqlcmd.ExecuteNonQuery();
                            DateTime end = DateTime.Now;

                            double count = 0;
                            DataTable dtSqlCount = new DataTable();
                            sqlcmd.CommandText = sqlCount;
                            SqlDataAdapter adp = new SqlDataAdapter(sqlcmd);
                            adp.Fill(dtSqlCount);

                            TimeSpan ts = end - st;
                            if (dtSqlCount != null && dtSqlCount.Rows.Count > 0)
                            {
                                count = Convert.ToInt32(dtSqlCount.Rows[0][0].ToString());
                            }

                            if (ts.TotalMilliseconds > 1000 && count > 0)
                            {
                                int pc = Convert.ToInt32(count / (ts.TotalMilliseconds * 0.001));
                                if (pc < performance)
                                {
                                    msg = string.Format("审核失败,查询效率过低,{0}/s.", pc);
                                    approve = false;
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        msg = "审核失败." + ex.Message;
                        approve = false;
                    }
                    finally
                    {
                        connection.Close();
                    }
                }
                //审核结果
                if (approve)
                    msg = "审核通过";
                IDataParameter[] upParas = new SqlParameter[5];
                upParas[0] = new SqlParameter("@ViewID", appInfo["vid"]);
                upParas[1] = new SqlParameter("@ViewGroupID", appInfo["id"]);
                upParas[2] = new SqlParameter("@AuditID", auditID);
                upParas[3] = new SqlParameter("@AuditStatus", approve ? 3 : 1);
                upParas[4] = new SqlParameter("@AuditResult", msg);
                con.StoredUpdate("Working_db.UP_SysView_UpdateApprove", upParas);

            }
            catch (Exception ex) { throw ex; }
        }
        /// <summary>
        /// 根据ID字段删除SysViewGroup表信息
        /// </summary>
        /// <param name="id">ID</param>
        public string Delete(string id)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                IDataParameter[] paras = new SqlParameter[2];
                paras[0] = new SqlParameter("@ID", id);
                paras[1] = new SqlParameter("@GID", "");
                DataTable dt = con.StoredDataTable("Working_db.UP_SysViewGroup_Delete", paras);
                if (dt != null && dt.Rows.Count > 0)
                {
                    return dt.Rows[0][0].ToString();
                }
                else
                    return "0";
            }
            catch (Exception ex) { throw ex; }
        }
        public bool DeleteCallBack(string id)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                SqlParameter[] para = new SqlParameter[]{
                new SqlParameter("@SysID",id)
                };
                con.ExecuteSql(@"delete from [Working_db].[ETL_CallBackParas] where ParentGUID in (select guid from [Working_db].[ETL_CallBackConfig] where SysID=@SysID);
delete from [Working_db].[ETL_CallBackConfig] where SysID=@SysID;", para);
                return true;
            }
            catch (Exception ex) { throw ex; }
        }
        //删除视图与组关联
        public void Delete(string id, string gid)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                IDataParameter[] paras = new SqlParameter[2];
                paras[0] = new SqlParameter("@ID", id);
                paras[1] = new SqlParameter("@GID", gid);
                con.StoredUpdate("Working_db.UP_SysViewGroup_Delete", paras);
            }
            catch (Exception ex) { throw ex; }
        }
        public DataTable ViewTableInfo(string schema, string name)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                IDataParameter[] paras = new SqlParameter[2];
                paras[0] = new SqlParameter("@Schema", schema);
                paras[1] = new SqlParameter("@Name", name);
                return con.StoredDataTable("Working_db.UP_SysView_ViewTableInfo", paras);
            }
            catch (Exception ex) { throw ex; }
        }
        /// <summary>
        /// 获取SysViewGroup对象列表
        /// </summary>
        public SysViewGroup GetItem(string id)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                SysViewGroup model = new SysViewGroup();
                DataTable dt = new DataTable();
                SqlParameter[] sqlparams = { new SqlParameter("@ID", id) };
                dt = con.StoredDataTable("Working_db.UP_SysViewGroup_GetItem", sqlparams);

                if (dt != null && dt.Rows.Count > 0)
                {
                    model.ID = dt.Rows[0]["ID"].ToString();
                    model.GroupName = dt.Rows[0]["GroupName"].ToString();
                    model.Description = dt.Rows[0]["Description"].ToString();
                    model.Status = Convert.ToInt32(dt.Rows[0]["Status"]);
                }
                return model;
            }
            catch (Exception ex) { throw ex; }
        }
        /// <summary>
        /// 获取SysViewGroup对象列表
        /// </summary>
        public List<SysViewGroup> GetInfoList(IDataParameter[] sqlparams)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                List<SysViewGroup> list = new List<SysViewGroup>();
                DataTable dt = new DataTable();
                dt = con.StoredDataTable("Working_db.UP_SysViewGroup_GetList", sqlparams);

                if (dt != null && dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {

                        SysViewGroup model = new SysViewGroup();

                        model.ID = row["ID"].ToString();
                        model.GroupName = row["GroupName"].ToString();
                        model.Status = Convert.ToInt32(row["Status"]);
                        model._parentId = row["_parentId"].ToString();
                        model.dbType = row["dbType"].ToString();
                        model.ViewSchema = row["ViewSchema"].ToString();
                        model.state = row["_parentId"].ToString() == "" ? "closed" : "";
                        list.Add(model);
                    }
                }
                return list;
            }
            catch (Exception ex) { throw ex; }
        }
        /// <summary>
        /// 获取SysViewGroup对象总数
        /// </summary>
        public int GetListCount(IDataParameter[] sqlparams)
        {
            try
            {
                HIDB.dbo con = base.ViewCon();
                DataTable dt = new DataTable();
                sqlparams.AddOne(new SqlParameter("@SysCode", loginInfo.ETLTargetCode));
                dt = con.StoredDataTable("Working_db.UP_SysViewGroup_GetCount", sqlparams);

                if (dt != null && dt.Rows.Count > 0)
                {
                    return Int32.Parse(dt.Rows[0]["Count"].ToString());
                }
                else
                    return 0;
            }
            catch (Exception ex) { throw ex; }
        }

        #region SysViewGroup

        public SysViewGroup GetViewGroupByGroupID(string groupID)
        {
            List<SysViewGroup> result = new List<SysViewGroup>();
            try
            {
                HIDB.dbo cmd = base.conn();
                string strSql = @"SELECT * FROM [Working_db].[SysViewGroup] 
WHERE [ID]=@ID";
                SqlParameter[] cmdParms = new SqlParameter[]
                {
                    new SqlParameter("@ID",groupID)
                };
                DataTable dt = cmd.GetDataTable(strSql, cmdParms);
                result = dt.MapToList<SysViewGroup>();
            }
            catch (Exception ex)
            {
                Logger.LogError("GetViewGroupByGroupID", "GetViewGroupByGroupID", 0, 1, ex, "", "");
            }
            if (result.Count > 0)
            {
                return result[0];
            }
            return null;
        }

        public List<SysViewGroup> GetViewGroupBySysCode(string sysCode
    , string orderBy, bool asc
    , int pageIndex, int pageSize, out int recordCount)
        {
            recordCount = 0;

            List<SysViewGroup> result = new List<SysViewGroup>();
            try
            {
                HIDB.dbo cmd = base.conn();
                string strSql = @"SELECT * FROM [Working_db].[SysViewGroup] 
WHERE [SysCode]=@SysCode";
                SqlParameter[] cmdParms = new SqlParameter[]
                {
                    new SqlParameter("@SysCode",sysCode)
                };
                DataTable dt = cmd.GetDataTable(strSql, cmdParms);
                result = dt.MapToList<SysViewGroup>();
                recordCount = result.Count;
                if (orderBy.Equals("GroupName", StringComparison.CurrentCultureIgnoreCase))
                {
                    if (asc == true)
                    {
                        result = result.OrderBy(p => p.GroupName).ToList();
                    }
                    else
                    {
                        result = result.OrderByDescending(p => p.GroupName).ToList();
                    }
                }
                else if (orderBy.Equals("Description", StringComparison.CurrentCultureIgnoreCase))
                {
                    if (asc == true)
                    {
                        result = result.OrderBy(p => p.Description).ToList();
                    }
                    else
                    {
                        result = result.OrderByDescending(p => p.Description).ToList();
                    }
                }
                if (pageIndex > -1 && pageSize > -1)
                {
                    result = result.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
                }
            }
            catch (Exception ex)
            {
                Logger.LogError("GetViewGroupBySysCode", "GetViewGroupBySysCode", 0, 1, ex, "", "");
            }
            return result;
        }


        public List<SysViewGroup> GetViewGroupBySysID(string sysID, string groupName
    , string orderBy, bool asc
    , int pageIndex, int pageSize, out int recordCount)
        {
            recordCount = 0;

            List<SysViewGroup> result = new List<SysViewGroup>();
            try
            {
                HIDB.dbo cmd = base.conn();
                string strSql = @"SELECT * FROM [Working_db].[SysViewGroup] 
WHERE [SysID]=@SysID";
                List<SqlParameter> cmdParms = new List<SqlParameter>()
                {
                    new SqlParameter("@SysID",sysID)
                };

                if (!groupName.IsNullOrEmpty())
                {
                    strSql += " AND GroupName=@GroupName";
                    cmdParms.Add(new SqlParameter("@GroupName", groupName));
                }
                DataTable dt = cmd.GetDataTable(strSql, cmdParms.ToArray());
                result = dt.MapToList<SysViewGroup>();
                recordCount = result.Count;
                if (orderBy.Equals("GroupName", StringComparison.CurrentCultureIgnoreCase))
                {
                    if (asc == true)
                    {
                        result = result.OrderBy(p => p.GroupName).ToList();
                    }
                    else
                    {
                        result = result.OrderByDescending(p => p.GroupName).ToList();
                    }
                }
                else if (orderBy.Equals("Description", StringComparison.CurrentCultureIgnoreCase))
                {
                    if (asc == true)
                    {
                        result = result.OrderBy(p => p.Description).ToList();
                    }
                    else
                    {
                        result = result.OrderByDescending(p => p.Description).ToList();
                    }
                }
                if (pageIndex > -1 && pageSize > -1)
                {
                    result = result.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
                }
            }
            catch (Exception ex)
            {
                Logger.LogError("GetViewGroupBySysCode", "GetViewGroupBySysCode", 0, 1, ex, "", "");
            }
            return result;
        }

        public List<SysViewGroup> GetViewGroupBySysID(string sysID, string groupName)
        {
            List<SysViewGroup> result = new List<SysViewGroup>();
            try
            {
                HIDB.dbo cmd = base.conn();
                string strSql = @"SELECT * FROM [Working_db].[SysViewGroup] 
WHERE [SysID]=@SysID";
                List<SqlParameter> cmdParms = new List<SqlParameter>()
                {
                    new SqlParameter("@SysID",sysID)
                };

                if (!groupName.IsNullOrEmpty())
                {
                    strSql += " AND GroupName=@GroupName";
                    cmdParms.Add(new SqlParameter("@GroupName", groupName));
                }
                DataTable dt = cmd.GetDataTable(strSql, cmdParms.ToArray());
                result = dt.MapToList<SysViewGroup>();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return result;
        }

        public List<SysViewGroup> GetViewGroupBySysIDWithOutGUID(string sysID, string groupID, string groupName)
        {
            List<SysViewGroup> result = new List<SysViewGroup>();
            try
            {
                HIDB.dbo cmd = base.conn();
                string strSql = @"SELECT * FROM [Working_db].[SysViewGroup] 
WHERE [SysID]=@SysID AND ID!=@ID";
                List<SqlParameter> cmdParms = new List<SqlParameter>()
                {
                    new SqlParameter("@SysID",sysID),
                    new SqlParameter("@ID",groupID)
                };

                if (!groupName.IsNullOrEmpty())
                {
                    strSql += " AND GroupName=@GroupName";
                    cmdParms.Add(new SqlParameter("@GroupName", groupName));
                }
                DataTable dt = cmd.GetDataTable(strSql, cmdParms.ToArray());
                result = dt.MapToList<SysViewGroup>();
            }
            catch (Exception ex)
            {
                Logger.LogError("GetViewGroupBySysCode", "GetViewGroupBySysCode", 0, 1, ex, "", "");
            }
            return result;
        }

        public List<SysViewGroup> GetViewGroupByGroupName(string groupName, string SysName)
        {
            List<SysViewGroup> result = new List<SysViewGroup>();
            try
            {
                HIDB.dbo cmd = base.conn();
                string strSql = @"SELECT g.*,s.TargetSysName FROM [Working_db].[SysViewGroup] g inner join [Working_db].ETL_TargetSystem s on g.SysID=s.GUID WHERE 1=1";
                List<SqlParameter> cmdParms = new List<SqlParameter>();

                if (!groupName.IsNullOrEmpty())
                {
                    strSql += " AND g.GroupName like '%'+@GroupName+'%'";
                    cmdParms.Add(new SqlParameter("@GroupName", groupName));
                }
                if (!SysName.IsNullOrEmpty())
                {
                    strSql += " AND s.TargetSysName like '%'+@SysName+'%'";
                    cmdParms.Add(new SqlParameter("@SysName", SysName));
                }
                DataTable dt = cmd.GetDataTable(strSql, cmdParms.ToArray());
                result = dt.MapToList<SysViewGroup>();
            }
            catch (Exception ex)
            {
                Logger.LogError("[Working_db].[SysViewGroup]", "GetViewGroupByGroupName", 0, 1, ex, "", "");
            }
            return result;
        }


        public int Insert(SysViewGroup groupInfo)
        {
            int num = -1;
            //创建cmd对象
            HIDB.dbo cmd = base.conn();
            //执行命令返回结果
            try
            {
                string strSql = @"INSERT INTO [Working_db].[SysViewGroup]
           ([ID]
           ,[GroupName]
           ,[Description] 
           ,[CreateTime]
           ,[SysID]
           ,[ConcurrentNum] )
     VALUES
           (@ID
           ,@GroupName
           ,@Description 
           ,getdate()
           ,@SysID 
           ,@ConcurrentNum )";
                SqlParameter[] cmdParms = new SqlParameter[]
                {
                    new SqlParameter("@ID",groupInfo.ID)
                     ,new SqlParameter("@GroupName",groupInfo.GroupName)
                     ,new SqlParameter("@Description",groupInfo.Description??string.Empty)
                     ,new SqlParameter("@Status",groupInfo.Status) 
                     ,new SqlParameter("@SysID",groupInfo.SysID) 
                     ,new SqlParameter("@ConcurrentNum",groupInfo.ConcurrentNum) 
                };
                num = cmd.ExecuteSql(strSql, cmdParms);
            }
            catch (Exception ex)
            {
                Logger.LogError("[Working_db].[SysViewGroup]", "Insert", 0, 1, ex, "", "");
            }
            return num;
        }

        public int Update(SysViewGroup groupInfo)
        {
            int num = -1;
            //创建cmd对象
            HIDB.dbo cmd = base.conn();
            //执行命令返回结果
            try
            {
                string strSql = @"UPDATE [Working_db].[SysViewGroup]
   SET [GroupName] = @GroupName
      ,[Description] = @Description 
      ,[ConcurrentNum] = @ConcurrentNum 
 WHERE ID=@ID";
                SqlParameter[] cmdParms = new SqlParameter[]
                {
                    new SqlParameter("@ID",groupInfo.ID)
                     ,new SqlParameter("@GroupName",groupInfo.GroupName)
                     ,new SqlParameter("@Description",groupInfo.Description??string.Empty)  
                     ,new SqlParameter("@ConcurrentNum",groupInfo.ConcurrentNum)
                };
                num = cmd.ExecuteSql(strSql, cmdParms);
            }
            catch (Exception ex)
            {
                Logger.LogError("[Working_db].[SysViewGroup]", "Update", 0, 1, ex, "", "");
            }
            return num;
        }

        public int Delete2(string groupID)
        {
            int num = -1;
            //创建cmd对象
            HIDB.dbo cmd = base.conn();
            //执行命令返回结果
            try
            {
                string strSql = @"DELETE FROM [Working_db].[SysViewGroup]
   WHERE ID=@ID";
                SqlParameter[] cmdParms = new SqlParameter[]
                {
                    new SqlParameter("@ID",groupID)
                };
                num = cmd.ExecuteSql(strSql, cmdParms);
            }
            catch (Exception ex)
            {
                Logger.LogError("[Working_db].[SysViewGroup]", "Delete", 0, 1, ex, "", "");
            }
            return num;
        }

        #endregion

        #region ETL_Push_ViewGroup

        public List<ETL_Push_ViewGroup> GetModelPushConfigByGroupID(string groupID)
        {
            List<ETL_Push_ViewGroup> result = new List<ETL_Push_ViewGroup>();
            try
            {
                HIDB.dbo cmd = base.conn();
                string strSql = @"SELECT * FROM [Working_db].[ETL_Push_ViewGroup] 
WHERE [ViewGroupID]=@ViewGroupID";
                List<SqlParameter> cmdParms = new List<SqlParameter>()
                {
                    new SqlParameter("@ViewGroupID",groupID)
                };

                DataTable dt = cmd.GetDataTable(strSql, cmdParms.ToArray());
                result = dt.MapToList<ETL_Push_ViewGroup>();
            }
            catch (Exception ex)
            {
                Logger.LogError("GetViewGroupBySysCode", "GetViewGroupBySysCode", 0, 1, ex, "", "");
            }
            return result;
        }

        public int DeleteModelPushConfigByGroupID(string groupID)
        {
            int num = -1;
            //创建cmd对象
            HIDB.dbo cmd = base.conn();
            //执行命令返回结果
            try
            {
                string strSql = @"DELETE FROM [Working_db].[ETL_Push_ViewGroup]
   WHERE ViewGroupID=@GroupID";
                SqlParameter[] cmdParms = new SqlParameter[]
                {
                    new SqlParameter("@GroupID",groupID)
                };
                num = cmd.ExecuteSql(strSql, cmdParms);
            }
            catch (Exception ex)
            {
                Logger.LogError("[Working_db].[ETL_Push_ViewGroup]", "DeleteModelPushConfigByGroupID", 0, 1, ex, "", "");
            }
            return num;
        }
        public int InsertModelPushConfig(ETL_Push_ViewGroup pushConfigInfo)
        {
            int num = -1;
            //创建cmd对象
            HIDB.dbo cmd = base.conn();
            //执行命令返回结果
            try
            {
                string strSql = @"INSERT INTO [Working_db].[ETL_Push_ViewGroup]
           ([GUID]
           ,[ViewGroupID]
           ,[ViewID]
           ,[IsSSISPush]
           ,[IsWebServicePush]
           ,[IsFullAmount]
           ,[IsDisable]
           ,[DeletedType]
           ,[IsBackDelete]
           ,[CreateUser]
           ,[CreateTime])
     VALUES(@GUID
           ,@ViewGroupID
           ,@ViewID
           ,@IsSSISPush
           ,@IsWebServicePush
           ,@IsFullAmount
           ,@IsDisable
           ,@DeletedType
           ,@IsBackDelete
           ,@CreateUser
           ,GETDATE())";
                SqlParameter[] cmdParms = new SqlParameter[]
                {
                    new SqlParameter("@GUID",pushConfigInfo.GUID)
                     ,new SqlParameter("@ViewGroupID",pushConfigInfo.ViewGroupID)
                     ,new SqlParameter("@ViewID",pushConfigInfo.ViewID)
                     ,new SqlParameter("@IsSSISPush",pushConfigInfo.IsSSISPush)
                     ,new SqlParameter("@IsWebServicePush",pushConfigInfo.IsWebServicePush)
                     ,new SqlParameter("@IsFullAmount",pushConfigInfo.IsFullAmount)
                     ,new SqlParameter("@IsDisable",pushConfigInfo.IsDisable)
                     ,new SqlParameter("@DeletedType",pushConfigInfo.DeletedType)
                     ,new SqlParameter("@IsBackDelete",pushConfigInfo.IsBackDelete)
                     ,new SqlParameter("@CreateUser",pushConfigInfo.CreateUser??string.Empty)
                };
                num = cmd.ExecuteSql(strSql, cmdParms);
            }
            catch (Exception ex)
            {
                Logger.LogError("[Working_db].[SysViewGroup]", "Insert", 0, 1, ex, "", "");
            }
            return num;
        }

        #endregion

    }
}